<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    const obj = {}
    const obj2 = {name: 'jack', info: [1, 2, 3]}

    function isEmpty(obj) {
        console.log(Object.getOwnPropertyNames(obj).length === 0) // 判断对象中的属性名的个数是否为空
        return Object.keys(obj).length === 0 && JSON.stringify(obj) === "{}"
    }

    console.log(isEmpty(obj))
</script>
</body>
</html>
